package cate.common.table.activity.customwarorder.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.customwarorder.row.CustomWarorderTaskRow;
import easy.java.dev.note.NoteClass;

import java.util.ArrayList;
import java.util.List;

@NoteClass("战令任务")
public class CustomWarorderTaskSheet extends ESheet<CustomWarorderTaskRow> {

    @Override
    public String getSheetName() {
        return "任务";
    }


    /** 根据任务类型获取任务 */
    public List<Integer> getTaskIds(int group, byte type) {
        List<Integer> taskIds = new ArrayList<>();
        for (CustomWarorderTaskRow row : this.getList()) {
            if (row.group == group && row.type == type) {
                taskIds.add(row.taskId);
            }
        }
        return taskIds;
    }

    public List<Integer> getTaskIds(int group) {
        List<Integer> taskIds = new ArrayList<>();
        for (CustomWarorderTaskRow row : this.getList()) {
            if (row.group == group) {
                taskIds.add(row.taskId);
            }
        }
        return taskIds;
    }

}
